<!--<?php print <<<EOT
-->
<style type="text/css">
.sidebar{width:130px;border-right:1px solid $tdcolor;}
.content_thread{margin-left:130px;border-left:1px solid $tdcolor;_float:left;_margin:0;}
.tabB{padding-left:0;}
.content_thread .hB{padding-left:10px;}
.tr3 td,.tr3 th,.tr2 td,.tr2 th{border-bottom:1px solid #dae7f0;padding:5px 0 5px 10px;}
.ftc{border:1px dotted #ccc;background:#f7f7f7;padding:10px;width:760px;}
</style>
<div id="breadCrumb">
		<img align="absmiddle" src="$imgpath/$stylepath/thread/home.gif" alt="forumlist" class="breadHome" /><em class="breadEm"></em><a href="$db_bfn_temp" title="$db_bbsname">$db_bbsname</a><!--
EOT;
if($forum_name){ print <<<EOT
--><em>&gt;</em><a href="thread.php?fid=$fid">$forum_name</a><em>&gt;</em><a href="forumcp.php">版块管理</a><!--
EOT;
}else{
print <<<EOT
--><em>&gt;</em><a href="forumcp.php">版块管理</a><!--
EOT;
}
print <<<EOT
-->
</div>
<div id="pw_content">
<!--
EOT;
if(!$action){ print <<<EOT
-->
<div class="h">
	<h2>基本统计信息</h2>
</div>
<div class="t f_one">
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr3">
<!--
EOT;
$i=0;
foreach($forumdb as $key=>$value){
$i++;
print <<<EOT
-->
<td valign="top" width="$j_wid">
	<div class="p10">
        <h2 class="mr10"><a href="thread.php?fid=$value[fid]">$value[name]</a></h2>
    	<a href="forumcp.php?action=edit&fid=$value[fid]" class="s7">版主特权</a>
        <div class="s6">
        <p>主 题 数: $value[topic]</p>
        <p>文 章 数: $value[article]</p>
        <p>今日主题:$value[tpost]</p>
        </div>
    </div>
</td>
<!--
EOT;
if($i==4){
$i=0;
print <<<EOT
-->
</tr><tr class="tr3">
<!--
EOT;
}}if($j_sum==4 && $i<4){
for($j=$i;$j<4;$j++){print <<<EOT
-->
<td class="f_one" valign="top" width="$j_wid"><br /></td>
<!--
EOT;
}}print <<<EOT
-->
</tr></table></div>
<!--
EOT;
}elseif($action=='edit'){
${$type} = 'class="current"';
print <<<EOT
-->
	<div id="sidebar" class="f_tree cc">
		<div class="sidebar">
			<div class="myForum">
                <h6>管理选项</h6>
        	</div>
            <div class="sideForum" id="sideForum">
                <dl class="one">
                    <dt>内部留言</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $msg><a href="forumcp.php?action=edit&type=msg&fid=$fid">留言管理</a></li>
                            <li $addmsg><a href="forumcp.php?action=edit&type=addmsg&fid=$fid">添加留言</a></li>
                        </ul>
                    </dd>
                </dl><!--
                <dl class="one">
                    <dt>版块编辑</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li><a href="forumcp.php?action=edit&type=notice&fid=$fid">公告管理</a></li>
                            <li><a href="forumcp.php?action=edit&type=add&fid=$fid">发布公告</a></li>
                            <li><a href="forumcp.php?action=edit&type=f_type&fid=$fid">主题分类</a></li>
                        </ul>
                    </dd>
                </dl>
                -->
<!--
EOT;
if($isGM || $forumcp_type['addnotice'] == 1 || $forumcp_type['allowtpctype'] == 1){print <<<EOT
-->
				<dl class="one">
                    <dt>版块编辑</dt>
                    <dd>
                        <ul class="pw_ulD">
<!--
EOT;
if($isGM || $forumcp_type['addnotice'] == 1){print <<<EOT
-->
                        	<li $notice><a href="forumcp.php?action=edit&type=notice&fid=$fid">公告管理</a></li>
                            <li $add><a href="forumcp.php?action=edit&type=add&fid=$fid">发布公告</a></li>
<!--
EOT;
}
if($isGM || $forumcp_type['allowtpctype'] == 1){print <<<EOT
-->
                            <li $f_type><a href="forumcp.php?action=edit&type=f_type&fid=$fid">主题分类</a></li>
<!--
EOT;
}print <<<EOT
-->
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
}print <<<EOT
-->
                <dl class="one">
                    <dt>帖子管理</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $report><a href="forumcp.php?action=edit&type=report&fid=$fid">举报帖</a></li>
                            <li $reward><a href="forumcp.php?action=edit&type=reward&fid=$fid">悬赏帖</a></li>
                            <li $thread><a href="forumcp.php?action=edit&type=thread&fid=$fid">主题列表</a></li>
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
if($isGM || pwRights($isBM,'viewcheck')){print <<<EOT
-->
                <dl class="one">
                    <dt>帖子审核</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $tcheck><a href="forumcp.php?action=edit&type=tcheck&fid=$fid">主题审核</a></li>
                            <li $pcheck><a href="forumcp.php?action=edit&type=pcheck&fid=$fid">回复审核</a></li>
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
}if($db_recycle){print <<<EOT
-->
				<dl class="one">
                    <dt>回收站</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $trecycle><a href="forumcp.php?action=edit&type=trecycle&fid=$fid">主题回收站</a></li>
                            <li $precycle><a href="forumcp.php?action=edit&type=precycle&fid=$fid">回复回收站</a></li>
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
}if($forumset['commend'] && $first_admin){print <<<EOT
-->
				<dl class="one">
                    <dt>版主特权</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $commend><a href="forumcp.php?action=edit&type=commend&fid=$fid">版主推荐列表</a></li>
                            <li $adminset><a href="forumcp.php?action=edit&type=adminset&fid=$fid">副版主任免</a></li>
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
}elseif($forumset['commend']){print <<<EOT
-->
				<dl class="one">
                    <dt>版主特权</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $commend><a href="forumcp.php?action=edit&type=commend&fid=$fid">版主推荐列表</a></li>
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
}elseif($first_admin){ print <<<EOT
-->
				<dl class="one">
                    <dt>版主特权</dt>
                    <dd>
                        <ul class="pw_ulD">
                        	<li $adminset><a href="forumcp.php?action=edit&type=adminset&fid=$fid">副版主任免</a></li>
                        </ul>
                    </dd>
                </dl>
<!--
EOT;
}print <<<EOT
-->
            </div>
        </div>
        <div class="content_thread cc">
            <div class="content_ie" style="min-height:800px;_height:800px;">
<!--
EOT;
if(in_array($type,array('thread','tcheck','pcheck','trecycle','precycle'))){
$starttime && $starttime = get_date($starttime,'Y-n-j');
$endtime && $endtime = get_date($endtime,'Y-n-j');
print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<form action="forumcp.php?action=edit&type=$type&fid=$fid" method="post">
<input type="hidden" name="ptable" value="$ptable"/>
<div class="h">搜索</div>
<table width="100%"><tr><td class="p10 f_two">
<span class="mr20">用&nbsp;户&nbsp;名&nbsp;：<input class="input" type="text" name="username" size="15" value="$username" /></span>
帖子类型：<select name="t_type" class="mr20">
		<option value="0">全部帖子</option>
		<option value="digest" $t_type_digest>精华帖</option>
		<option value="active" $t_type_active>活动帖</option>
		<option value="reward" $t_type_reward>悬赏帖</option>
		<option value="sale" $t_type_sale>交易帖</option>
		</select>
发表日期：<input class="input" type="text" name="starttime" size="15" id="starttime" onClick="javascript:ShowCalendar(this.id)" value="$starttime"/>&nbsp;-&nbsp;<input class="input" type="text" name="endtime" size="15" id="endtime" onClick="javascript:ShowCalendar(this.id)" value="$endtime"/>
<span class="btn2"><span><button type="submit">提 交</button></span></span>
</td></tr></table>
</form>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($type=='notice'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="type" value="n_order" />
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="fid" value="$fid" />
<div class="h">站点公告编辑</div>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td width="20">ID</td>
		<td width="*">标题</td>
		<td width="8%">顺序</td>
		<td width="8%">状态</td>
		<td width="90">发布者</td>
		<td width="100">开始时间</td>
		<td width="100">结束时间</td>
		<td width="90">操作</td>
	</tr>
<!--
EOT;
$id=0;
foreach($annoucedb as $value){
$value[ifopen] = $value[ifopen] ? ($timestamp<$value[startdate] ? '未发布' : ($value[enddate] && $timestamp>$value[enddate] ? '已过期' : '已发布')) : '已关闭';
$id++;print <<<EOT
-->
	<tr class="tr3">
		<td>$id</td>
		<td align="left">$value[subject]</td>
		<td><input class="input" name="vieworder[$value[aid]]" value="$value[vieworder]" style="width:20px;"></td>
		<td>$value[ifopen]</td>
		<td>$value[author]</td>
		<td>$value[starttime]</td>
		<td>$value[endtime]</td>
		<td><a href="forumcp.php?action=edit&type=edit&fid=$fid&aid=$value[aid]" class="mr10 s4">[编辑]</a><a href="javascript:;" onclick="return delnotice('$value[aid]')" class="mr10 s4">[删除]</a></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
	<tr><td colspan="8" class="p10">$pages</td></tr>
	<tr><td colspan="8"><div class="tac p10"><span class="btn"><span><button type="submit" name="add">提 交</button></span></span></div></td></tr>
</table>
</form>
<script>
function delnotice(aid) {
	if (!aid || !confirm('确定要删除此公告吗？')) {
		return false;
	}
	location.href = 'forumcp.php?action=edit&type=n_del&fid=$fid&verify=$verifyhash&aid=' + aid;
	return false;
}
</script>
<!--
EOT;
}elseif(in_array($type,array('add','edit'))){print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<form name="FORM" method="post" action="forumcp.php?">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="action" value="$action">
<input type="hidden" name="type" value="$type">
<input type="hidden" name="fid" value="$fid">
<input type="hidden" name="aid" value="$aid">
<input type="hidden" name="step" value="2">
<div class="h">更新公告信息</div>
<div>
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr3">
        	<td width="100">是否开启:</td>
            <td colspan="2"><label class="mr20" for="ifopen1"><input type="radio" id="ifopen1" name="ifopen" value="1" $ifopen_Y> 开启</label><label for="ifopen0"><input type="radio" id="ifopen0" name="ifopen" value="0" $ifopen_N> 关闭</label></td>
        </tr>
		<tr class="tr3 f_two">
        	<td>公告标题</td>
			<td colspan="2"><input class="input" name="atc_title" value="$subject" size="35"></td>
        </tr>
		<tr class="tr3">
        	<td>起始日期<br />结束日期</td>
			<td width="120"><input class="input" name="startdate" id="starttime" onclick="ShowCalendar(this.id,1);"  value="$startdate" size="15" style="margin-bottom:8px;"><br /><input class="input" id="endtime" onclick="ShowCalendar(this.id,1);" name="enddate" value="$enddate" size="15"></td>
            <td>格式:(YYYY-MM-DD HH:II，如:1983-12-20 00:00)<br />起始时间:公告开始发布的时间，留空则使用当前时间<br />结束时间:公告结束发布的时间，留空则公告不结束</td>
       	</tr>
		<tr class="tr3 f_two">
        	<td>显示顺序</td>
			<td colspan="2"><input class="input" name="vieworder" value="$vieworder" size="35"></td>
        </tr>
		<tr class="tr3 vt">
        	<td>公告内容<br /><span class="s2">不支持 html 代码</span></td>
            <td colspan="2" style="padding-right:10px;">
<!--
EOT;
require PrintEot('wysiwyg_editor_common');
print <<<EOT
-->
			</td></tr>
		<tr>
            <td class="p10 tac" colspan="3"><span class="btn"><span><button type="submit" name="add">提 交</button></span></span></td>
        </tr>
</table>
</div>
</form>
<script src="js/wind_editor.js"></script>
<script src="js/post.js"></script>
<!--
EOT;
}elseif($type=='report'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">会员举报帖处理</div>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td width="25">ID</td>
		<td width="60">版块</td>
		<td width="60">帖子位置</td>
		<td width="90">反映用户</td>
		<td>原因:</td>
		<td width="60">报告类型</td>
		<td width="40">删除</td>
	</tr>
<!--
EOT;
$id=0;
foreach($reportdb as $report){
$id++;
print <<<EOT
-->
	<tr class="tr3 vt">
		<td>$id</td>
		<td><a href="thread.php?fid=$report[fid]" target="_blank">$report[fname]</a></td>
		<td><a href="read.php?tid=$report[tid]#$report[pid]" target="_blank">进入帖子</a></td>
		<td><a target="_blank" href="{$db_userurl}$report[uid]">$report[username]</a></td>
		<td><div style="line-height:18px;height:18px;overflow:hidden;width:400px;" title="$report[reason]">$report[reason]</div></td>
<!--
EOT;
if($report[type]==1){ print <<<EOT
-->
		<td>优秀帖子</td>
<!--
EOT;
}else{ print <<<EOT
-->
		<td>不良帖子</td>
<!--
EOT;
} print <<<EOT
-->
		<td><input type="checkbox" name="selid[]" value="$report[id]" /></td></tr>
<!--
EOT;
}print <<<EOT
-->
	<tr><td colspan="7" class="p10">$pages</td></tr>
	<tr>
		<td colspan="7" class="p10 tac">
		<span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 选</button></span></span>
		<span class="btn"><span><button type="submit" name="add">提 交</button></span></span>
		</td>
	</tr>
</table>
<input type="hidden" name="action" value="del" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="type" value="report" />
</form>
<!--
EOT;
}elseif($type=='f_type'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">版块主题分类</div>
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr3">
			<td width="70">列表显示：</td>
			<td>
				<label class="mr20"><input type="radio" value="1" $addtpctype_Y name="addtpctype" /> 开启</label>
				<label class="mr20"><input type="radio" value="0" $addtpctype_N name="addtpctype" /> 关闭</label><span class="s6">（开启后帖子列表页显示主题分类）</span>
			</td>
		</tr>
		<tr class="tr3 f_two">
			<td width="70">发帖控制：</td>
			<td>
				<label class="mr20"><input type="radio" value="2" $t_type_2 name="t_type" /> 强制分类</label>
				<label class="mr20"><input type="radio" value="1" $t_type_1 name="t_type" /> 允许分类</label>
				<label class="mr20"><input type="radio" value="0" $t_type_0 name="t_type" /> 关闭分类</label>
			</td>
		</tr>
		<tr class="tr3 vt">
			<td style="padding:0;border-bottom:0;" colspan="2">
				 <div class="admin_table_c">
						<table cellpadding="0" cellspacing="0" width="100%">
								<tr class="tr2">
										<td width="40">系统组</td>
										<td width="60">顺序</td>
										<td width="175">名称</td>
										<td width="350">图标URL</td>
										<td width=""><a class="cp s2" onclick="addtype();">[添加一级分类]</a></td>
									</tr>
<!--
EOT;
foreach ($typedb as $key => $value){
$ifsystype = $value['ifsys'] ? 'checked' : '';
print <<<EOT
-->
									<tr id="ttype_$value[id]">
										<td><input type="checkbox" value="1" name="t_sys_db[$key]" $ifsystype /></td>
										<td><input type="text" class="input" style="width:20px;" value="$value[vieworder]" name="t_view_db[$key]"></td>
										<td><input type="text" class="input input_wa" value="$value[name]" name="t_db[$key]" /></td>
										<td><input type="text" class="input input_wb" value="$value[logo]" name="t_logo_db[$key]" /></td>
										<td><a href="javascript:;" onclick="addSubType($value[id]);" class="s4 mr10">[添加二级分类]</a><a href="forumcp.php?action=edit&type=f_type&fid=$fid&dodel=delttype&typename=top&id=$value[id]" onclick="return confirm('确定要删除此主题分类吗？删除此主题分类将同时删除其二级分类');">[删除]</a></td>
									</tr>
<!--
EOT;
	foreach ($subtypedb as $k => $v){
		if ($key == $v['upid']){
		$ifsubsystype = $v['ifsys'] ? 'checked' : '';
print <<<EOT
-->
									<tr id="ttype_$v[id]">
										<td><input type="checkbox" value="1" name="t_sys_db[{$v[id]}]" $ifsubsystype /></td>
										<td>|&mdash;&nbsp;<input type="text" class="input" style="width:20px;" name="t_view_db[{$v[id]}]" value="$v[vieworder]"></td>
										<td><input type="text" class="input input_wa" value="$v[name]" name="t_db[{$v[id]}]" /></td>
										<td><input type="text" class="input input_wb" value="$v[logo]" name="t_logo_db[{$v[id]}]" /></td>
										<td><a href="forumcp.php?action=edit&type=f_type&fid=$fid&dodel=delttype&typename=sub&id=$v[id]" onclick="return confirm('确定要删除此主题分类吗？');">[删除]</a></td>
									</tr>
<!--
EOT;
		}
	}print <<<EOT
-->
									<tbody id="t_sub_body_$value[id]"></tbody>
<!--
EOT;
}print <<<EOT
-->
								<tbody id="tbody"></tbody>
								<tbody id="tmode" style="display:none"><tr><td></td><td><input type="text" class="input" style="width:20px;" name="new_t_view_db[]"></td><td><input type="text" class="input input_wa" value="" name="new_t_db[]" /></td><td><input type="text" class="input input_wb" name="new_t_logo_db[]" /></td><td>&nbsp;</td></tr></tbody>
								<tbody id="t_sub_mode" style="display:none"><tr><td></td><td>|&mdash;&nbsp;<input type="text" class="input" style="width:20px;" name="new_t_sub_view_db"></td><td><input type="text" class="input input_wa" value="" name="new_t_sub_db" /></td><td><input type="text" class="input input_wb" name="new_t_sub_logo_db" /></td><td>&nbsp;</td></tr></tbody>
						</table>
					</div>
       </td>
    </tr>
</table>
<div class="p10 tac"><span class="btn"><span><button type="submit" name="add">提 交</button></span></span></div>
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="type" value="f_type" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="step" value="3" />
</form>
<script type="text/javascript" src="js/pw_ajax.js"></script>
<script>
function addtype(){
	var s = getObj('tmode').firstChild.cloneNode(true);
	getObj('tbody').appendChild(s);
}

function addSubType(id) {
	var inputs = getObj('t_sub_mode').getElementsByTagName('input');
	inputs[0].name = "new_t_sub_view_db\["+id+"\]\[\]";
	inputs[1].name = "new_t_sub_db\["+id+"\]\[\]";
	inputs[2].name = "new_t_sub_logo_db\["+id+"\]\[\]";
	var s = getObj('t_sub_mode').firstChild.cloneNode(true);
	getObj('t_sub_body_'+id).appendChild(s);
}

addtype();
</script>
<!--
EOT;
}elseif($type=='reward'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<div class="h">悬赏帖到期处理</div>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td width="35">ID</td>
		<td width="*">悬赏主题</td>
		<td width="12%">悬赏作者</td>
		<td width="12%">&nbsp;悬赏时间</td>
		<td width="15%">版块</td>
		<td width="12%">最佳答案奖励</td>
		<td width="12%">热心助人奖励</td>
	</tr>
<!--
EOT;
$i=($page-1)*$db_perpage;
foreach($threaddb as $key=>$thread){
$i++;
print <<<EOT
-->
	<tr class="tr3 vt">
		<td>$i</td>
		<td align="left"><a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a></td>
		<td><a href="{$db_userurl}$thread[authorid]" target="_blank">$thread[author]</a></td>
		<td>$thread[postdate]</td>
		<td><a href="thread.php?fid=$fid">{$forum[$fid][name]}</a></td>
		<td>$thread[binfo]</td>
		<td>$thread[ainfo]</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
</form>
<!--
EOT;
}elseif($type=='thread'){ print <<<EOT
-->
<form action="mawhole.php?jumptype=forumcp" method="post">
<div class="h">主题列表</div>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td width="35">选项</td>
		<td>标题</td>
		<td width="100px">作者</td>
		<td width="120px">发表日期</td>
	</tr>
<!--
EOT;
foreach($threaddb as $key=>$thread){print <<<EOT
-->
<tr class="tr3 vt">
	<td><input type="checkbox" name="tidarray[]" value="$thread[tid]" /></td>
	<td>
<!--
EOT;
if($thread[specialsort]==PW_THREADSPECIALSORT_KMD){print <<<EOT
-->
<img src="$imgpath/pwicon/headtopic_4.gif" alt="孔明灯帖标志" align="absmiddle" />		
<!--
EOT;
}elseif($thread[topped]){print <<<EOT
-->
<img src="$imgpath/$stylepath/file/headtopic_$thread[topped].gif" alt="置顶帖" align="absmiddle" />
<!--
EOT;
}print <<<EOT
-->
		<a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a>
<!--
EOT;
if($thread[digest]){ print <<<EOT
-->
<img src="$imgpath/$stylepath/file/digest_$thread[digest].gif" alt="精华帖" align="absmiddle" />
<!--
EOT;
}print <<<EOT
-->
	</td>
	<td><a target="_blank" href="{$db_userurl}$thread[authorid]">$thread[author]</a></td>
	<td>$thread[postdate]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<div class="tac p10">
	<span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 选</button></span></span>
	<span class="btn"><span><button type="submit" name="hello">删 除</button></span></span>
</div>
<input type="hidden" name="action" value="del" />
<input type="hidden" name="fid" value="$fid" />
</form>
<!--
EOT;
}elseif($type=='tcheck'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">主题审核</div>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2">
	<td width="35">选项</td>
	<td>标题</td>
	<td width="100px">作者</td>
	<td width="120px">发表日期</td>
</tr>
<!--
EOT;
foreach($threaddb as $key=>$thread){print <<<EOT
-->
<tr class="tr3 vt">
	<td><input type="checkbox" name="selid[]" value="$thread[tid]" /></td>
	<th onclick="content('$thread[tid]');" class="cp"><a href="read.php?tid=$thread[tid]" target="_blank" class="s4 fr">[查看原帖]</a>$thread[subject]</th>
	<td><a href="{$db_userurl}$thread[authorid]">$thread[author]</a></td>
	<td>$thread[postdate]</td>
</tr>
<tr class="tr3" id="content_$thread[tid]" style="display:none;"><td colspan="4" style="padding:5px 10px;"><div class="ftc">$thread[content]</div></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
if($pages){print <<<EOT
-->
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<!--
EOT;
}print <<<EOT
-->
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div class="p10 f_two">
		短消息通知：
		<label class="mr10"><input type="radio" name="ifmsg" value="1" checked />是</label>
		<label class="mr20"><input type="radio" name="ifmsg" value="0"/>否</label><span class="mr20 gray">|</span>审核：
	<label class="mr10"><input type="radio" name="step" value="3" checked /> 通过</label>
	<label class="mr10"><input type="radio" name="step" value="5" /> 删除</label>
	<span class="bt2"><span><button type="button" onclick="CheckAll(this.form)" name="chkall">全 选</button></span></span>
	<span class="btn2"><span><button type="submit" name="hello">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($type=='pcheck'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">
<!--
EOT;
if($db_plist && count($db_plist)>1){print <<<EOT
-->
<select onchange="window.location=('forumcp.php?action=$action&type=$type&fid=$fid&ptable='+this.value);" class="fr" name="ptable">$p_table</select>
<!--
EOT;
}print <<<EOT
-->
回复审核</div>
<table width="100%" class="z">
<tr class="tr2">
	<td width="35">选项</td>
	<td>回复内容</td>
	<td width="100px">作者</td>
	<td width="120px">发表日期</td>
</tr>
<!--
EOT;
foreach($postdb as $key=>$post){print <<<EOT
-->
<tr class="tr3">
	<td><input type="checkbox" name="selid[]" value="$post[pid]" /></td>
	<th onclick="content('$post[pid]');"><a href="job.php?action=topost&tid=$post[tid]&pid=$post[pid]" target="_blank" class="fr s4">[查看原帖]</a>$post[subject]</th>
	<td><a href="{$db_userurl}$post[authorid]">$post[author]</a></td>
	<td>$post[postdate]</td>
</tr>
<tr class="tr3" id="content_$post[pid]" style="display:none;"><td colspan="4" style="padding:5px 10px"><div class="ftc">$post[content]</div></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
if($pages){print <<<EOT
-->
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<!--
EOT;
}print <<<EOT
-->
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div class="p10 f_two">
		短消息通知：
		<label class="mr10"><input type="radio" name="ifmsg" value="1" checked />是</label>
		<label class="mr20"><input type="radio" name="ifmsg" value="0"/>否</label><span class="mr20 gray">|</span>审核：
	<label class="mr10"><input type="radio" name="step" value="3" checked /> 通过</label>
	<label class="mr10"><input type="radio" name="step" value="5" /> 删除</label>
	<span class="bt2"><span><button type="button" onclick="CheckAll(this.form)" name="chkall">全 选</button></span></span>
	<span class="btn2"><span><button type="submit" name="hello">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($type=='commend'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">版主推荐列表</div>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2">
	<td width="30">选项</td>
	<!--td width="35">ID</td-->
	<td>标题</td>
	<td width="100px">作者</td>
	<td width="120px">发表日期</td>
</tr>
<!--
EOT;
$i=0;
foreach($commendThread as $key=>$thread){
$i++;
print <<<EOT
-->
<tr class="tr3">
	<td><input type="checkbox" name="selid[]" value="$thread[tid]" /></td>
	<!--td>$i</td-->
	<th><a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a></th>
	<td><a href="{$db_userurl}$thread[authorid]">$thread[author]</a></td>
	<td>$thread[postdate]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="step" value="2" />
<div class="p10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(this.form)" name="chkall">全 选</button></span></span>
	<span class="btn"><span><button type="submit" name="hello">删 除</button></span></span>
</div></form>
<!--
EOT;
}elseif($type=='adminset'){print <<<EOT
-->
<form action="forumcp.php?action=edit&type=$type" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">副版主任免</div>
<table width="100%">
	<tr class="tr3">
		<td width="80">第一版主</td>
		<td>$firstadmin</td>
	</tr>
	<tr class="tr3 f_twp">
		<td>版主</td>
		<td><input class="input input_wb" type="text" name="forumadmin" value="$s_admin" /></td>
	</tr>
</table>
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="step" value="3" />
<div class="tac p10"><span class="btn"><span><button type="submit" name="hello">提 交</button></span></span></div></form>
<!--
EOT;
}elseif($type=='trecycle' && $db_recycle){print <<<EOT
-->
<div class="h">主题回收站</div>
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" style="table-layout:fixed;">
<tr class="tr2">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td width="35">选择</td>
<!--
EOT;
}print <<<EOT
-->
	<td>标题</td>
	<td width="80px">作者</td>
	<td width="120px">发帖时间</td>
	<td width="80px">管理员</td>
	<td width="120px">删除日期</td>
</tr>
<!--
EOT;
foreach($recycledb as $key=>$thread){
$thread['fname'] && $fromforum = '['.$thread['fname'].']';
print <<<EOT
-->
<tr class="tr3">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td><input type="checkbox" name="ids[]" value="$thread[tid]" /></td>
<!--
EOT;
}print <<<EOT
-->
	<th><a href="thread.php?fid=$thread[fid]" target="_blank" class="fr s4">$fromforum</a><span class="cp" onclick="content('$thread[tid]');">$thread[subject]</span></th>
	<td><a href="{$db_userurl}$thread[authorid]">$thread[author]</a></td>
	<td>$thread[postdate]</td>
	<td>$thread[admin]</td>
	<td>$thread[deltime]</td>
</tr>
<tr class="tr3" id="content_$thread[tid]" style="display:none;"><td colspan="5" style="padding:5px 10px"><div class="ftc">$thread[content]</div></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div class="tac p10">
<!--
EOT;
if($forumset['recycle']){print <<<EOT
-->
<select name="step" class="mr5">
	<option value="0">选择操作</option>
<!--
EOT;
}if($forumset[recycle] & 2){print <<<EOT
-->
	<option value="1">删除帖子</option>
<!--
EOT;
}if($forumset[recycle] & 4){print <<<EOT
-->
	<option value="2">还原帖子</option>
<!--
EOT;
}if($forumset[recycle] & 8){print <<<EOT
-->
	<option value="3">清空帖子</option>
<!--
EOT;
}print <<<EOT
-->
</select>
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<span class="bt"><span><button type="button" onclick="CheckAll(this.form)">全 选</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onclick="return Psubmit(this.form)">提 交</button></span></span>
<!--
EOT;
}print <<<EOT
-->
</div></form>
<!--
EOT;
}elseif($type=='precycle' && $db_recycle){print <<<EOT
-->
<form action="forumcp.php" method="post" name="FORM">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">
<!--
EOT;
if($db_plist && count($db_plist)>1){print <<<EOT
-->
<select onchange="window.location=('forumcp.php?action=$action&type=$type&fid=$fid&ptable='+this.value);" class="fr" name="ptable">$p_table</select>
<!--
EOT;
}print <<<EOT
-->
回复回收站
</div>
<table width="100%" style="table-layout:fixed;">
<tr class="tr2">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td width="35">选择</td>
<!--
EOT;
}print <<<EOT
-->
	<td>标题</td>
	<td width="80">作者</td>
	<td width="120">回帖时间</td>
	<td width="80">管理员</td>
	<td width="120">删除日期</td>
</tr>
<!--
EOT;
foreach($recycledb as $key=>$posts){print <<<EOT
-->
<tr class="tr3">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td><input type="checkbox" name="ids[]" value="$posts[pid]" /></td>
<!--
EOT;
}print <<<EOT
-->
	<th class="cp" onclick="content('$posts[pid]');"><a href="read.php?tid=$posts[tid]" target="_blank" class="fr s4">[查看主题帖]</a>$posts[subject]</th>
	<td><a href="{$db_userurl}$posts[authorid]">$posts[author]</a></td>
	<td>$posts[postdate]</td>
	<td>$posts[admin]</td>
	<td>$posts[deltime]</td>
</tr>
<tr class="tr3" id="content_$posts[pid]" style="display:none;"><td colspan="5" style="padding:5px 10px"><div class="ftc">$posts[content]</div></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div class="tac p10">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
<select name="step" class="mr5">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<option value="0">选择操作</option>

<!--
EOT;
}if($forumset[recycle] & 2){print <<<EOT
-->
	<option value="1">删除回复</option>
<!--
EOT;
}if($forumset[recycle] & 4){print <<<EOT
-->
<option value="2">还原回复</option>
<!--
EOT;
}if($forumset[recycle] & 8){print <<<EOT
-->
<option value="3">清空回复</option>
<!--
EOT;
}print <<<EOT
-->
</select>
<!--
EOT;
}
if($forumset[recycle]){print <<<EOT
-->
	<span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 选</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onclick="return Psubmit(this.form)">提 交</button></span></span>
</div></form>
<!--
EOT;
}}elseif($type=='addmsg'){
$adminsel = '<label class="mr10"><input type="checkbox" name="msgtype" value="1" checked>所有版主</label>';
foreach ($adminname as $val) {
	if($val!=$windid && $val){
		$adminsel .= "<label class=\"mr10\"><input type=\"checkbox\" name=\"toname[]\" value=\"$val\">$val</label>";
	}
}
print <<<EOT
-->
<form name="FORM" method="post" action="forumcp.php?">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="action" value="$action">
<input type="hidden" name="type" value="$type">
<input type="hidden" name="fid" value="$fid">
<input type="hidden" name="step" value="2">
<div class="h">添加内部留言</div>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td width="80">留言对象</td>
		<td>$adminsel<span class="s6"> （管理员及总版主不受限制）</span></td>
	</tr>
	<tr class="tr3 f_two">
		<td>有效期时间至</td>
		<td><input class="input" name="savetime" value="30" size="4"> 天 （请输入整数）</td>
	</tr>
	<tr class="tr3">
		<td valign="top">留言内容</td>
		<td><textarea name="message" class="textareaA"></textarea></td>
	</tr>
	<tr>
		<td></td>
		<td style="padding:5px;"><span class="btn2"><span><button type="submit" name="add">提 交</button></span></span></td>
	</tr>
</table>
</form>
<!--
EOT;
}elseif($type=='msg'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h">内部留言管理</div>
<table width="100%" style="table-layout:fixed;">
<tr class="tr2">
	<td width="35">选项</td>
	<td>内容</td>
	<td width="100">留言人</td>
	<td width="120">留言时间</td>
	<td width="120">有效期时间至</td>
</tr>
<!--
EOT;
foreach($msgdb as $key=>$val){
$val['ifuse'] = !S::inArray($val['uid'],$notManager) ? $val['ifuse'] : '';
print <<<EOT
-->
<tr class="tr3">
	<td><input type="checkbox" name="ids[]" value="$val[id]" $val[ifuse]/></td>
	<td  id="content_$val[id]">$val[message]</td>
	<td>$val[username]</td>
	<td>$val[posttime]</td>
	<td>$val[savetime]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<table width="100%"><tr><td class="p10">$pages</td></tr></table>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="demsg" value="1">
<div class="p10 tac">
<span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 选</button></span></span>
<span class="btn"><span><button type="submit">删除</button></span></span>
</div></form>
<!--
EOT;
}print <<<EOT
-->
            </div>
        </div>
    </div>
<script>
/*function CheckAll(form){
	for(var i=0;i<form.elements.length-2;i++){
		var e = form.elements[i];
		if(e.type=='checkbox' && e.disabled == false) e.checked = e.checked == true ? false : true;
	}
}*/

function CheckAll(form) {
	var ifcheck = null;
	for (var i=0;i<form.elements.length-2;i++){
		var e = form.elements[i];
		if(e.type=='checkbox' && e.disabled == false){
			if (ifcheck === null) ifcheck = !e.checked;
			e.checked = ifcheck;
		}
	}
	return ifcheck;	
}

function content(id){
	var o = getObj('content_'+id);
	o.style.display = o.style.display == 'none' ? '' : 'none';
}
function Psubmit(form){
	//var ids = form['ids[]'];
	var ids = form.getElementsByTagName('input');
	var flag = false;
	for(var i=0; i<ids.length; i++){
		if(ids[i].type == 'checkbox' && ids[i].name == 'ids[]' &&  ids[i].checked){
			flag = true; break;
		}
	}
	if(false == flag){
		showDialog({type:'warning',message:'请选择要操作的项!'});return false;
	}
	switch(form.step.value){
		case '0':
			alert('请先选择操作,再提交');
			break;
		case '1':
			return confirm('您确认要进行删除操作吗?');
			break;
		case '2':
			return confirm('您确认要进行还原操作吗?');
			break;
		case '3':
			return confirm('您确认要对该版块进行清除操作吗?');
			break;
	}
	return false;
}
</script>
<!--
EOT;
}
print <<<EOT
-->
</div>
<script type="text/javascript">
/*侧栏版块展开动态*/
window.onReady(function(){
	var div = document.getElementById("sideForum");
	var tt = div.getElementsByTagName("dt");
	for(i=0; i<tt.length; i++){
		tt[i].index = i;
		tt[i].onclick= function(){
			document.cookie='hide_'+this.index+'='+(this.parentNode.className == 'one' ? 1 : 0);
			this.parentNode.className = this.parentNode.className == 'one'?'':'one';
		}
	}
	/*
	var sfs = document.getElementById('shortcutforum').getElementsByTagName('li');
	for (i=0;i<sfs.length;i++) {
		sfs[i].onmouseover=function(){this.className='hover';}
		sfs[i].onmouseout=function(){this.className='';}
	}
	*/
});

function toggleSidebar(){
	var sidebar = getObj('sidebar');
	var toggle = (sidebar.className == 'f_tree cc') ? 0: 1;
	SetCookie('toggle',toggle);	
	getObj('sidebar').className = (sidebar.className == 'f_tree cc')?"f_tree cc sideClose":'f_tree cc';
}
</script>
<!--
EOT;
?>-->